<?php
//getting the cart id from the cookie
$shoppingcart_id = $_COOKIE["shoppingcart_id"];

//getting the item id from the request
$item_id = $_GET["item"];

//perform the mysql query to link the two elements inside DB
mysql_query("INSERT INTO REL (ID_CART, ID_ITEM) VALUES ('$shoppingcart_id', '$item_id')");
?>